package Month4;

import java.io.File;
import java.io.IOException;

public class a20250424FileTest2
{
    public static void main(String[] args) throws IOException
    {
        File f = new File("mufile\\aaa");
        File[] files = f.listFiles();
        for (File temp : files)
        {
            System.out.println(temp.getName());
        }
        System.out.println(haveMp4(f));

        File mp4 = new File("mufile\\aaa\\wuqi.mp4");
        try
        {
            mp4.createNewFile();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        for (File temp : files)
         {
           System.out.print(temp.getName());
         }
        System.out.println(haveMp4(f));
    }
    public static boolean haveMp4(File f)
    {
        File[] files = f.listFiles();
        for (File temp : files)
        {
            if(temp.isFile() && temp.getName().endsWith("mp4"))
            {
                return true;
            }
        }
        return false;
    }
}
